package com.samphanie.security.security.properties;

/**
 * @author ZSY
 * @email 1451691457@qq.com
 */
public interface AuthConstants {

    /**
     * 后台管理client_id
     */
    String ADMIN_CLIENT_ID = "admin-client";

    /** 第三方登录 */
    String DEFAULT_PARAMETER_NAME_SOCIAL = "social";
    /** 默认的手机验证码登录请求处理url */
    String DEFAULT_LOGIN_PROCESSING_URL_MOBILE = "/auth/mobile";
    /** 默认的第三方请求回调 */
    String DEFAULT_LOGIN_PROCESSING_URL_SOCIAL = "/auth1/callback/**";

    String TOKEN_BLACKLIST_PREFIX = "auth:token:blacklist:";

    /** 刷新模式 */
    String REFRESH_TOKEN = "refresh_token";
    /** 授权码模式 */
    String AUTHORIZATION_CODE = "authorization_code";
    /** 客户端模式 */
    String CLIENT_CREDENTIALS = "client_credentials";
    /** 密码模式 */
    String PASSWORD = "password";
    /** 简化模式 */
    String IMPLICIT = "implicit";

    /** 自定义client表名 */
    String CLIENT_TABLE = "oauth_client_details";

    /** 基础查询语句 */
    String CLIENT_BASE = "select client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, " +
            "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity," +
            "refresh_token_validity, additional_information, auto_approve from " + CLIENT_TABLE;
    String FIND_CLIENT_DETAIL_SQL = CLIENT_BASE + " order by client_id";
    String SELECT_CLIENT_DETAIL_SQL = CLIENT_BASE + " where client_id = ?";

}
